package Oefening30;

import java.util.*;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		List atleten = new ArrayList();
		Set athleten = new HashSet();
		
		Tienkamper persoon1 = new Tienkamper("Tia Hellebauter",4562);
		Tienkamper persoon2 = new Tienkamper("Usain Bolt",56872);
		Tienkamper persoon3 = new Tienkamper("Elodie Ouedraogo",4562);
		Tienkamper persoon4 = new Tienkamper("Enzo Scifo",4532);
		
		atleten.add(persoon1);
		atleten.add(persoon2);
		atleten.add(persoon3);
		atleten.add(persoon4);
		
		Collections.sort(atleten);
		toonArrayList(atleten);
		
		
		
		athleten.add(persoon1);
		athleten.add(persoon2);
		athleten.add(persoon3);
		athleten.add(persoon4);
		
		toonTreeSet(athleten);
		System.out.println("----------------------");
		System.out.println( athleten.contains(persoon2) );
		persoon2.setNaam("Usain Italic");
		System.out.println( athleten.contains(persoon2) );
		System.out.println("----------------------");
		toonTreeSet(athleten);
		
		

	}
	
	public static void toonArrayList(List atleten){
		System.out.println("\nArrayList verzameling ***\n");
		for(Object obj:atleten){
			
			System.out.println(obj);
		}
	}
	
	public static void toonTreeSet(Set athleten){
		System.out.println("\nTreeSet verzameling ***\n");
		for(Object obj:athleten){
			
			System.out.println(obj);
		}
	}

}
